package com.dog.modules.iot.mqtt.consumer.controller;

import cn.hutool.json.JSONUtil;
import com.dog.modules.iot.dto.common.RobotBasicParamUploadDTO;
import com.dog.modules.iot.mqtt.consumer.annotation.CmdDispatcher;
import com.dog.modules.iot.mqtt.consumer.annotation.CmdMapping;
import com.dog.modules.iot.mqtt.consumer.enums.InCommandType;
import lombok.extern.slf4j.Slf4j;

/**
 * 室内洗地机指令
 *
 */
@CmdDispatcher
@Slf4j
public class CleanRobotCmdController extends BaseCmdDispatcher {

    /**
     *
     *{
     * 	"data": {
     * 		"deviceCode": "str",
     * 		"requestId": "str",
     * 		"basicSettings": {
     * 			"upper_camera": "str",
     * 			"lower_camera": "str",
     * 			"brush_motor_preclose": "str",
     * 			"brush_lift_preclose": "str",
     * 			"sewage_motor_preclose": "str",
     * 			"water_motor_preclose": "str",
     * 			"water_lift_preclose": "str",
     * 			"wind_motor_preclose": "str",
     * 			"wind_delay_preclose": "str",
     * 			"water_motor_low": "str",
     * 			"water_motor_mid": "str",
     * 			"water_motor_high": "str",
     * 			"water_motor_param": "str",
     * 			"water_motor_time_low": "str",
     * 			"water_wait_time_low": "str",
     * 			"water_motor_time_mid": "str",
     * 			"water_wait_time_mid": "str",
     * 			"water_motor_time_high": "str",
     * 			"water_wait_time_high": "123",
     * 			"sewage_motor_set": "123",
     * 			"sewage_motor_during_time": "123",
     * 			"sewage_motor_time": "1234",
     * 			"wind_motor_set": "33",
     * 			"speed_set_1": "33",
     * 			"speed_set_2": "42",
     * 			"speed_set_3": "111",
     * 			"speed_set_trans": "32",
     * 			"edge_distance": "12"
     *                }* 	},
     * 	"header": {
     * 		"cmd": 1002,
     * 		"deviceCode": "00002592vGzf"
     * 	}
     * }
     *
     *
     *
     * @param deviceCode
     * @param data
     */

    @CmdMapping(cmd = InCommandType.BASIC_PARAM_DATA_UP)
    public void cleanRobotBasicParamData(String deviceCode, RobotBasicParamUploadDTO data) {
            data.setDeviceCode(deviceCode);
            log.info("处理设备基本参数上传: {} ", JSONUtil.toJsonStr(data));

    }


}
